<!DOCTYPE html>
<html>
<head>
  <title>日志管理</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
  <link href="/css/bootstrap-responsive.css" rel="stylesheet" media="screen">
  <link rel="stylesheet" type="text/css" href="/css/style.css">
  <script src="/lib/jq/jquery-2.1.1.min.js"></script>
  <script src="/lib/jq/bootstrap.min.js"></script>
  <script type="text/javascript" src="/js/bootstrap-paginator.min.js"></script>
  <script type="text/javascript" src="/js/jquery.qrcode.min.js"></script>
  <script type="text/javascript" src="/js/qrcodeM.js"></script>
   <script>
    $(function(){

    //获得浏览器参数
    $.extend({
    getUrlVars: function(){
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i
    < hashes.length; i++){
    hash = hashes[i].split('=');
    vars.push(hash[0]);
    vars[hash[0]] = hash[1];
    }
    return vars;
    },
    getUrlVar: function(name){
    return $.getUrlVars()[name];
    }
    });

    //封装浏览器参数
    var composeUrlParams=function(){
    var param='';
    $.each($.getUrlVars(), function(i, item) {
    if(item!='p'){
    var val=$.getUrlVar(item);
    if(val) param += "&" + item+"="+val;
    }
    });
    return param;
    }

    //分页功能
    var options = {
    currentPage:<%- page.num %>,
    totalPages:<%- page.pageCount %>,
    numberOfPages:5,
    pageUrl: function(type, page, current) {    //页面跳转
    if(page!=<%- page.num %>){
    return '/box_management/log?num='+ page;
    }
    }
    }
    $('#page4').bootstrapPaginator(options);
    })
    </script>
</head>
<body style="margin:15px;">
<legend>操作记录</legend>
    <table class="table table-bordered" style="width:98%;margin:15px;">
        <tr>
            <td style="text-align: center;width:15%">操作人</td>
            <td style="text-align: center;width:15%">箱子_ID</td>
            <td style="text-align: center;width:25%">时间</td>
            <td style="text-align: center;width:40%">操作内容</td>
        </tr>
        <% for(var i=0;i<datas.length;i++){ %>
        <tr>
            <td style="text-align: center;width:15%"><%=datas[i].user%></td>
            <%if(datas[i].box_id){%>
            <td style="text-align: center;width:15%"><%=datas[i].box_id%></td>
            <%}else{%>
            <td style="text-align: center;width:15%"></td>
            <%}%>
            <td style="text-align: center;width:25%"><%=dates[i]%></td>
            <td style="text-align: center;width:40%"><%=datas[i].operation%></td>
        </tr>
        <%}%>
    </table>
    <div class="span12">
        <div id="page4"></div>
    </div>
</body>
</html>